<template>
	<view>
		<!-- #ifdef APP -->
		<view class="" style="width: 100rpx;height: 40px;"></view>
		<!-- #endif -->
		<view class="bcc">
			<view class="topView">

				<view class="topBg">

				</view>
				<view class="" style="position: absolute;left: 0rpx;bottom: 0; width: 686rpx;">
					<!-- 			<view class="" style="margin-top:-316rpx;"> -->
					<view class=" flex-row-space-between">
						<view class="leftView flex-row-flex-start" @click="handleLocation">
							<!-- <image class="dizhi" src="/static/index/dz.png" mode=""></image> -->
							<u-icon class="dizhi" name="map" color="#fff" size="36rpx"></u-icon>

							<view class="city">
								{{city}}
							</view>
							<!-- <u-icon name="arrow-down" color="#ffffff"></u-icon> -->
						</view>
						<view class="flex1 flex-row-flex-start">
							<view class="rightView flex1 flex-row-flex-start">
								<image class="sousuoImage" src="/static/index/ss1.png" mode=""></image>
								<input class=" flex1" placeholder="请输入陪玩昵称" v-model="technician"
									@confirm='searchClick()'>
							</view>
							<view @click='searchClick()' class="ssImage">
								搜索
								<!-- <image src="../../static/index/ss1.png" mode=""></image> -->
							</view>
						</view>


					</view>


				</view>
				<view class="swipe flex-row-space-between" style="padding: 50rpx 30rpx;">
					<view class="flex-column-center">
						<image class="icon1" src="../../static/index/1.png" mode=""></image>
						<view class="iconTitle">
							假扮女友
						</view>
					</view>
					<view class="flex-column-center">
						<image class="icon1" src="../../static/index/2.png" mode=""></image>
						<view class="iconTitle">
							陪诊接送
						</view>
					</view>
					<view class="flex-column-center">
						<image class="icon1" src="../../static/index/3.png" mode=""></image>
						<view class="iconTitle">
							电竞健身
							
						</view>
					</view>
					<view class="flex-column-center">
						<image class="icon1" src="../../static/index/4.png" mode=""></image>
						<view class="iconTitle">
							逛街美食
						</view>
					</view>
				</view>
				<!-- <view class="swipe" @click="swipeClick()">
					<u-swiper :list="swiperList" keyName="image" indicator indicatorMode="line" circular height="280rpx"
						width='700rpx'></u-swiper>
				</view> -->
				<!-- <view class="notice flex-row-flex-start">
					<view class="ttImage">
						<image src="/static/index/tt.png" mode=""></image>
					</view>
			
					<view class="notice-center">
						<u-notice-bar :show-icon="true" :scrollable="false" speed="50px" :single="true"
							style="padding: 0rpx 12rpx ;" icon=" " color="#5406CD" bgColor="#E2F4E900" :text="tips">
						</u-notice-bar>
					</view>
			
				</view> -->
				<!-- <view class="nav flex-row-space-between">
					<view class="nav_box" v-for="(item,index) in list" @click="gopath(item.path)" :key="index">
						<image :src="item.icon"></image>
						<text>{{item.name}}</text>
					</view>
				</view>
				<view class="tabs">
					<view class="navView flex-row-space-between">
						<view v-for="(item,index) in list1" @click="click(item,index)" :key="index">
							<view :class="[tabsIndex==index?'selected':'']" class="navItem flex-row-center">
								{{item.name}}
							</view>
						</view>
					</view>
					
				</view> -->
			</view>

		</view>

		<view class="flex-wrap flex-row-space-between" style="margin: 0 30rpx;">
			<view class="flex-wrap flex-row-space-between">
				<view class="left" @click="tourl(1)">
					<view class="text">
						<view class="text1">
							城市代理
						</view>
						<view class="text2">
							热门加盟中
						</view>
					</view>
					<image src="../../static/index/im1.png" class="left_img" mode=""></image>
				</view>
				<view class="right">
					<view class="right_t" @click="tourl(2)">
						<view class="text">
							<view class="text1">
								陪玩招募
							</view>
							<view class="text2">
								时间能变现
							</view>
						</view>
						<image src="../../static/index/im2.png" class="right_t_img" mode=""></image>
					</view>
					<view class="right_b" @click="tourl(3)">
						<view class="text">
							<view class="text1">
								申请分销商
							</view>
							<view class="text2">
								你的财富触手可及
							</view>
						</view>
						<image src="../../static/index/im3.png" class="right_b_img" mode=""></image>
					</view>
				</view>
			</view>
			<view class="item" v-for="(item,index) in dataList" @click="goDeil(item)" :key="index">
				<!-- <view class="head">
					<image :src="item.avatar" mode="aspectFill"></image>
					<view v-if="item.work_status==1" class=" zaixian flex-row-center">
						在线中
					</view>
					<view v-if="item.work_status==2" class=" zaixian lixian flex-row-center">
						离线
					</view>
					<view v-if="item.work_status==3" class=" zaixian lixian1  flex-row-center">
						忙时可预
					</view>
				</view> -->
				<view class="head">
					<image :src="item.avatar" mode="aspectFill"></image>
					<view v-if="item.work_status==1" class=" zaixian flex-row-center">
						<view class=""
							style="width: 16rpx;height: 16rpx;background: #2EF252;border-radius: 50%;margin-right: 8rpx;">

						</view>在线
					</view>
					<!-- <view v-if="item.work_status==2" class=" zaixian lixian flex-row-center">
						休息中
					</view>
					<view v-if="item.work_status==3" class=" zaixian lixian1  flex-row-center">
						服务中
					</view> -->
					<view v-if="item.work_status==3 || item.work_status==2" class=" zaixian lixian1  flex-row-center">
						<view class=""
							style="width: 16rpx;height: 16rpx;background: #bbb;border-radius: 50%;margin-right: 8rpx;">

						</view>
						忙碌
					</view>
				</view>

				<view class="xinzeng">
					<view class="flex1" style="justify-content: space-between;">
						<!-- <view class="dashang" @click.stop="dashang(item.tid)">
							打赏
						</view> -->
						<view class="name">
							{{item.nickname}}
						</view>
						<view class="flex-row-flex-start">

							<view class="real flex-row-center" v-if="item.sex == '男'">
								<u-icon name="man" color="#fff" size="26rpx"></u-icon>
								24
							</view>
							<view class="real flex-row-center" v-if="item.sex == '女'">
								<u-icon name="woman" color="#fff" size="26rpx"></u-icon>
								24
							</view>
						</view>
					</view>
					<view class="flex1" style="margin-top: 5rpx;margin-bottom: 5rpx;">
						<view class="height">
							{{item.height}}cm
						</view>

						<view class="weight">
							{{item.weight}}kg
						</view>
						<view class="distance">
							<!-- <image src="/static/index/address.png" mode=""></image> -->
							{{(item.distance/1000).toFixed(1)}}km
						</view>
					</view>
					<view class=" flex-row-space-between" style="margin-top: 5rpx;margin-bottom: 5rpx;">
						<view class="shoucang" @click.stop="follow(item.tid)">
							收藏
						</view>
						<view class="jianmian" @click.stop="jianmian(item.tid)">
							预约
						</view>
						<!-- <view class="flex-row-flex-start">
						
							<view class="real flex-row-center" v-if="item.sex == '男'">
								<u-icon name="man" color="#fff" size="26rpx"></u-icon>
								24
							</view>
							<view class="real flex-row-center" v-if="item.sex == '女'">
								<u-icon name="woman" color="#fff" size="26rpx"></u-icon>
								24
							</view>
						</view>
						
						<view class="address flex-row-flex-end">
							<view class="jianmian" @click.stop="jianmian(item.tid)">
								预约
							</view>
						</view> -->
					</view>
				</view>
			</view>
		</view>

		<!-- 打赏弹窗 -->
		<u-popup :show="show" @close="show=false" :round="15" mode="center">
			<view class="mod-box">
				<view class="modTitle">
					请选择打赏金额(￥)
				</view>
				<view class="moneyList flex-wrap flex-row-center">
					<view class="flex-row-center boxM" :class="money1==item?'boxM1':'boxM'"
						v-for="(item,index) in moneyList" @click="tomoney(item)">
						<text>{{item}}</text>
					</view>
				</view>
				<view class="modTitle">
					请输入打赏金额
				</view>
				<view class="flex-row-center">
					<view class="inputView">
						<input type="number" v-model="money1" placeholder="打赏金额">
					</view>
				</view>
				<view class="modTitle1">
					注意：打赏金额不可退
				</view>
				<view class="flex-row-center">
					<view @click="callMoney()" class="modButton flex-row-center">
						确定
					</view>
				</view>
			</view>
		</u-popup>
		<!-- 下单弹窗 -->
		<u-popup :show="show1" @close="show1=false" :round="15" mode="bottom">
			<view class="jm-box" style="width: 690rpx;">
				<view class="header">
					<image style="width: 180rpx;height: 180rpx;border-radius: 10rpx;" :src="detil.avatar"
						mode="aspectFill">
					</image>
					<view class="" style="margin-left: 20rpx;">
						<view class="name" style="margin:0 0 40rpx 8rpx;color: #000;">
							{{detil.nickname}}
						</view>
						<view class="real flex-row-center" v-if="detil.sex == '男'">
							<u-icon name="man" color="#fff" size="26rpx"></u-icon>
							<!-- {{detil.age}} -->
							24
						</view>
						<view class="real flex-row-center" v-if="detil.sex == '女'">
							<u-icon name="woman" color="#fff" size="26rpx"></u-icon>
							<!-- {{detil.age}} -->
							24
						</view>
					</view>
				</view>
				<view class="txt">
					当前位置
				</view>
				<view class="active">
					<u-icon class="dizhi" name="map" size="36rpx"></u-icon>
					<view class="mydizhi" @click="showCity">{{mydizhi}}
					</view>
				</view>
				<view class="txt">
					和TA一起
				</view>

				<view class="itembox">
					<view :class="index == i?'item1 i':'item1'" v-for="(item,i) in detil.service" @click="geti(item,i)"
						:key="i">
						<view :class="index == i?'xmName0':'xmName'">
							{{item.name}}
						</view>
						<view class="">
							<text :class="index == i?'price0':'price'">￥</text>
							<text :class="index == i?'price01':'price1'">{{item.price}}</text>
							<text :class="index == i?'price02':'price2'">/{{parseInt(item.duration)}}小时</text>
							<!-- 						<text class="price2">/{{item.duration}}小时</text> -->
						</view>
					</view>
				</view>
				<view @click="goPay()" class="bottomButton flex-row-center">
					立即下单
				</view>
			</view>
		</u-popup>
		<!-- 下单须知 -->
		<u-popup :show="show2" @close="show2=false" :round="15" mode="center">
			<view class="jm-box">
				<view class="" style="font-size: 38rpx;font-weight: bold; text-align: center;margin-bottom: 20rpx;">
					下单须知
				</view>
				<rich-text :nodes="nodes"></rich-text>
				<view @click="show1=true,show2=false" style="width: 590rpx;margin-top: 20rpx;"
					class="bottomButton flex-row-center">
					知道了
				</view>
			</view>
		</u-popup>
		<!-- 接单 -->
		<u-popup :show="jiedan" @close="jiedan=false" :round="15" mode="center">
			<view class="jm-box" style="width: 500rpx; min-height: 300rpx;">
				<view class="" style="font-size: 38rpx;font-weight: bold; text-align: center;margin-bottom: 20rpx;">
					达人已接单
				</view>
				<view class="" style="font-size: 30rpx;text-align: center;">
					可前往订单详情与达人电话确认
				</view>
				<view @click="jiedan=false" style="width: 440rpx;margin-top: 60rpx;"
					class="bottomButton flex-row-center">
					知道了
				</view>
			</view>
		</u-popup>
		<!-- 取消 -->
		<u-popup :show="quxiao" @close="quxiao=false" :round="15" mode="center">
			<view class="jm-box" style="min-height: 200rpx;">
				<view class="" style="font-size: 38rpx;font-weight: bold; text-align: center;margin-bottom: 20rpx;">
					达人取消订单
				</view>
				<view class="" style="font-size: 30rpx;text-align: center;">
					可前往订单详情查看达人取消原因
				</view>
				<view @click="quxiao=false" style="width: 440rpx;margin-top: 20rpx;"
					class="bottomButton flex-row-center">
					知道了
				</view>
			</view>
		</u-popup>
	</view>
</template>
<script>
import {
	checkOpenGPSServiceByAndroid
} from "../../config/device.js"
export default {
	data () {
		return {
			tabsIndex: 0,
			list: [{
				path: '/bundle/pages/daili/daili',
				name: '城市代理',
				icon: '/static/index/csdl.png'
			},
			{
				path: '/bundle/pages/settled/settled',
				name: '我要入驻',
				icon: '/static/index/wyrz.png'
			},
			{
				path: '/bundle/pages/daili/daili1',
				name: '合伙申请',
				icon: '/static/index/yqhy.png'
			},
			{
				path: '/pages/my/wenti',
				name: '常见问题',
				icon: '/static/index/cjwt.png'
			}, ],
			list1: [{
				name: '精选',
			}, {
				name: '新人',
			}, {
				name: '附近'
			}, {
				name: '男达人'
			}, {
				name: '女达人'
			}],
			status: 0,
			page: 1,
			latitude: '',
			longitude: '',
			city: "",
			dataList: [],
			total: null,
			loading: true,
			swiperList: [],
			tips: '',
			technician: '',
			type: '',
			show: false,
			show1: false,
			show2: false,
			jiedan: false,
			quxiao: false,
			moneyList: [],
			money1: '',
			detil: '',
			index: -1,
			nodes: '',
			mydizhi: ''



		};
	},
	onLoad (e) {
		var that = this
		if (e.code) {
			uni.setStorageSync('shareCode', e.code)
		}
		that.$http.post('api/sys/article', {
			id: '1'
		}).then(res => {
			this.nodes = res.content;
			console.log(res);
		})
		that.swiper()
		that.postTips()
		setTimeout(function () {
			// #ifdef H5
			that.getLat()
			// #endif
			// #ifdef APP
			that.getLocation()
			// #endif
		}, 1000);
		that.getda()
		if (uni.getStorageSync('pid')) {
			setTimeout(() => {

				uni.navigateTo({
					url: '/bundle/pages/settled/settled'
				});
			}, 2000)
		}
	},
	onShow () {
		// console.log(1);
		if (uni.getStorageSync('order_status') == 1) {
			this.jiedan = true
			uni.setStorageSync('order_status', 0)
		}
		if (uni.getStorageSync('order_status') == 2) {
			this.quxiao = true
			uni.setStorageSync('order_status', 0)
		}
		// uni.setStorageSync('isIndex', 0)
		uni.$on("cityName", res => {
			this.city = res.city;
			this.technicianList()
			// 清除监听
			uni.$off('cityName');
		})
		let userInfo = uni.getStorageSync("userInfo");
		console.log('userInfo', userInfo.token)

		if (userInfo.token) {
			this.userDetail()
		}
		this.init('精选')

		this.$http.post('api/user/detail').then(res => {
			uni.setStorageSync('user', res)
			console.log("res.openid", res.openid)
			if (res.openid) {

			} else {
				this.getOpenId()
			}

		});
	},

	methods: {
		follow (id) {
			this.$http.post('api/collect/technician', {
				tid: id
			}).then(res => {
				console.log(res, '/////');
				uni.showToast({
					icon: 'none',
					title: res
				});
				// this.getDetil(this.id)
				// this.money = 0
			})
		},
		tourl (type) {
			let url
			if (type == 1) {
				url = '/bundle/pages/daili/daili2'
			}
			else if (type == 2) {
				url = '/bundle/pages/settled/settled'
			}
			else {
				url = '/bundle/pages/daili/daili1?status=0'
			}
			uni.navigateTo({
				url
			})
		},
		showCity () {
			uni.chooseLocation({
				success: (res) => {
					console.log(res)
					this.mydizhi = res.name
				}
			})
		},
		goPay () {
			if (this.index == -1) {
				uni.showToast({
					icon: 'none',
					title: '请选择项目'
				})
				return
			}
			uni.setStorageSync('dataList', this.detil)
			uni.navigateTo({
				url: '/pages/confirm_order/confirm_order?item=' + JSON.stringify(this.xiangmu)
			})
		},
		geti (item, i) {
			this.index = i
			this.xiangmu = item
			console.log(item);
		},
		jianmian (tid) {
			this.show2 = true
			this.$http.post('api/index/technician/detail', {
				tid: tid,
				latitude: 0,
				longitude: 0
			}).then(res => {
				// console.log('技师详情', res)
				this.detil = res
				// this.swipe = res.album
				// this.service = res.service
				// this.images = res.dynamic.images
				// console.log('this.images', this.images)
				// console.log(this.swipe, '---')
				// // if(res.dynamic){
				// // 	this.item1=res.dynamic[0]
				// // 	// this.images=res.dynamic[0].images
				// // }
				// this.video = res.dynamic.video
				// this.url = res.dynamic.video
				// this.videoImage = res.dynamic.videoImage
				// if (this.url.length) {
				// 	this.imageIndex = 3
				// 	// this.getVideoPoster(this.url)
				// }

				// for (var i = 0; i < res.service.length; i++) {
				// 	let a = {
				// 		id: res.service[i].id,
				// 		num: 0
				// 	}
				// 	this.arress.push(a)
				// }
				// console.log(this.arress, '88888');
			})

		},
		dashang (id) {
			this.show = true
			this.id = id
		},
		callMoney () {
			// #ifdef APP-PLUS
			this.$http.post('api/pay/reward', {
				tid: this.id,
				money: this.money1,
				pay_method: 'app支付宝'
			}).then(res => {
				console.log(res, '-----------------------');
				uni.requestPayment({
					provider: 'alipay',
					orderInfo: res, //支付宝订单数据
					success: function (res) {
						console.log('success:' + JSON.stringify(res));
						uni.showToast({
							icon: 'none',
							title: '打赏成功'
						});
						this.show = false

					},
					fail: function (err) {

						console.log('fail:' + JSON.stringify(err));
						uni.showToast({
							icon: 'none',
							title: '支付失败'
						});

					}
				});
			})
			// #endif
			// #ifdef H5
			this.$http.post('api/pay/reward', {
				tid: this.id,
				money: this.money1,
				pay_method: 'h5微信'
			}).then(res => {
				pay(res).then(res => {
					console.log(res, 'res打印的res ')
					uni.showToast({
						title: res,
						icon: 'success'
					})

				});
				this.show = false
				uni.showToast({
					title: '感谢打赏',
					icon: 'success'
				})

			})
			// #endif

		},
		tomoney (money) {
			this.money1 = money
		},
		getda () {
			this.$http.post('api/sys/reward').then(res => {
				this.moneyList = res
			})
		},
		userDetail () {
			// 获取个人信息
			this.$http.post('api/user/detail').then(res => {
				if (Number(res.is_partner) == 2) {
					this.list[2].name = '分享赚佣'
					this.list[2].path = '/pages/user/zhiwen-share/zhiwen-share'
				}
				if (Number(res.technician_apply_status) == 1) {
					this.list[1].name = '登录达人端'
				} else {

				}
			});


		},

		getUrlCode () { // 截取url中的code方法
			console.log('3333333333333333333333333333333333333333', '8788')
			var url = location.search
			if (location.search.indexOf('&divform=') != -1) {
				url = location.search.split('&divform=')[0]
			}

			var theRequest = new Object()
			if (url.indexOf("?") != -1) {
				var str = url.substr(1)
				var strs = str.split("&")
				for (var i = 0; i < strs.length; i++) {
					theRequest[strs[i].split("=")[0]] = (strs[i].split("=")[1])
				}
			}

			return location.search.indexOf('&divform=') != -1 ? {
				...theRequest,
				divform: decodeURIComponent(location.search.split('&divform=')[location.search.split('&divform=')
					.length - 1])
			} : theRequest
		},
		getOpenId () {
			// if (location.search.indexOf('code') == -1) {

			// } else {
			// uni.showToast({
			// 	title: this.getUrlCode().code + 'index。this.getUrlCode().code',
			// 	icon: 'none'
			// })
			this.$http.get('api/login/bandwx', {
				code: this.getUrlCode().code
			}).then(res => {
				uni.showToast({
					title: '获取get_openid'
				})
				console.log(`uni.setStorageSync('openid',res.data.openid)`, "*********")
				console.log(res)
				uni.setStorageSync('openid', res.openid ? res.openid : uni.getStorageSync('openid'))
			});
			// }
		},
		searchClick () {
			// uni.navigateTo({
			// 	url:'/pages/index/search'
			// })
			if (!this.technician) {
				uni.showToast({
					title: '不能为空',
					icon: 'none'
				});
				return
			}
			this.$http.post('api/index/technician/list', {
				search: this.technician
			}).then(res => {
				console.log(res);
				this.dataList = res
				if (this.dataList.length) {
					uni.showToast({
						title: '搜索成功',
						icon: 'none'
					});
				} else {
					uni.showToast({
						title: '无搜索结果',
						icon: 'none'
					});
				}

			})
		},
		getNewListData () {
			uni.showLoading({
				title: '加载中'
			})
			this.$http.post('api/user/log/sysmessage', {
				page: 1,
				limit: 10
			}).then(res => {
				uni.hideLoading()
				uni.setStorageSync('msg', res[0].is_read)
			})
		},
		search () { //搜索
			// if(!this.technician){
			// 	uni.showToast({
			// 		title: '不能为空',
			// 		icon: 'none'
			// 	});
			// 	return
			// }
			// 	this.$http.post('api/index/technician/search',{
			// 		name:this.technician
			// 	}).then(res=>{
			// 		this.goDeil(res)
			// 	})


		},
		click (item, index) {
			this.tabsIndex = index
			this.dataList = []
			this.init(item.name)
		},
		gopath (url) {
			uni.navigateTo({
				url
			})
		},
		goDeil (item) {
			uni.navigateTo({
				url: '/bundle/pages/techDeil/techDeil?id=' + item.tid
			})
		},
		swiper () {
			this.$http.post('api/sys/banner').then(res => {
				this.swiperList = res
			})
		},
		postTips () {
			this.$http.post('api/sys/notice').then(res => {
				this.tips = res.content
			})
		},
		async getLocation () {



			let _this = this
			uni.getLocation({
				altitude: false,
				geocode: true,
				type: 'gcj02',
				success: (res) => {
					console.log(res);
					console.log("获取经纬度成功", res);
					_this.local = 1
					let {
						latitude,
						longitude,
						address
					} = res;
					console.log(address, 'address');
					if (!address) {
						address = {}
					}
					address.longitude = longitude;
					address.latitude = latitude;
					let wz = uni.getStorageSync('address_info')
					uni.setStorageSync('address_info', address)

					_this.Dzarr(longitude, latitude)

					_this.latitude = address.latitude;
					_this.longitude = address.longitude;
				},
				fail: (err) => {
					console.log("获取经纬度失败");
					console.log(err)
					checkOpenGPSServiceByAndroid()

				},
			})
		},


		getLat () {
			let _this = this
			uni.getLocation({
				altitude: false,
				geocode: true,
				type: 'wgs84',
				success: (res) => {
					console.log(res);
					_this.local = 1
					let {
						latitude,
						longitude,
						address
					} = res;
					// console.log(address, 'address');
					if (!address) {
						address = {}
					}
					address.longitude = longitude;
					address.latitude = latitude;
					let wz = uni.getStorageSync('address_info')
					uni.setStorageSync('address_info', address)

					_this.Dzarr(longitude, latitude)

					_this.latitude = address.latitude;
					_this.longitude = address.longitude;


				},
				fail: (err) => {
					console.log(err)
				}
			})
		},

		handleLocation () {
			uni.navigateTo({
				url: '/pages/index/city'
			})

			// 	uni.chooseLocation({
			// 		success: (res) => {


			// 			let latAndLng = {}
			// 			latAndLng.lat = res.latitude
			// 			latAndLng.lng = res.longitude
			// 			// let currentSite = {}
			// 			var regex = /^(北京市|天津市|重庆市|上海市|香港特别行政区|澳门特别行政区)/;
			// 			var REGION_PROVINCE = [];
			// 			var currentSite = {
			// 				province: null,
			// 				city: null,
			// 				district: null,
			// 				address: null
			// 			};

			// 			if (!regex.exec(res.address)) {
			// 				regex = /^(.*?(省|自治区))(.*?)$/;
			// 				// console.log(res,'我的大大');
			// 				this.latitude=res.latitude
			// 				this.longitude=res.longitude

			// 				REGION_PROVINCE = regex.exec(res.address);

			// 				currentSite.province = REGION_PROVINCE[1];
			// 				currentSite =this.regexAddressBean(REGION_PROVINCE[3], currentSite,res);
			// 			} else {
			// 				REGION_PROVINCE = regex.exec(res.address);
			// 				currentSite.province = REGION_PROVINCE[1];
			// 				currentSite =this.regexAddressBean(res.address, currentSite,res);
			// 			}
			// 			  if(currentSite.city=='郑州'){
			// 				  currentSite.city='郑州市'
			// 			  }
			// 			  this.city=currentSite.city
			// 			setTimeout(res=>{
			// 				this.dataList=[]
			// 				this.init('精选')
			// 			},500)
			// 			/* this.currentSite=currentSite */
			// 		}
			// 	});
		},
		regexAddressBean (address, addressBean, res) {
			var regex = /^(.*?[市州]|.*?地区|.*?特别行政区)(.*?[市区县])(.*?)$/g;
			var addxress = regex.exec(address);
			addressBean.city = addxress[1];
			addressBean.district = addxress[2];
			addressBean.address = addxress[3] + "(" + res.name + ")";
			return addressBean;
		},


		Dzarr (longitude, latitude) {
			this.$http.post('api/map_address', {
				longitude: longitude,
				latitude: latitude
			}).then(res => {
				console.log(res, '------------------------');
				// console.log(JSON.stringify(res), '------------------------');
				this.mydizhi = res.formatted_address
				this.city = res.addressComponent.city
				this.init('精选');
			})
		},
		technicianList () {
			let obj = {
				city: this.city,
				latitude: this.latitude,
				longitude: this.longitude,
				page: this.page,
				search: '',
				limit: 10000,
				sex: '',
				sort: '离我最近'
				// sort: this.type
			}
			// if (this.type == '精选') {
			// 	this.$delete(obj, 'city');
			// 	// this.$delete(obj, 'latitude'); 
			// 	//   this.$delete(obj, 'longitude'); 
			// }

			if (this.value) {
				obj.realname = this.value
			}
			this.$http.post('api/index/technician/list', obj).then(res => {
				this.dataList = res
				/* let {
					list,
					total
				} = res; */
				// for (var i = 0; i < res.length; i++) {

				// 	this.dataList.push(res[i]);
				// }
				/* this.total = total; */
				this.loading = false;
			})
		},
		init (type) {
			console.log(type);
			if (type == '男达人') {
				this.type = '男助理'
			} else if (type == '女达人') {
				this.type = '女助理'
			} else {
				this.type = type
			}
			this.technicianList()

		}

	}
};
</script>

<style scoped lang="scss">
page {

	padding-bottom: 120rpx;
}

.bcc {
	width: 750rpx;
	height: 380rpx;
	background: #EAC3FD;
	position: relative;
	padding: 50rpx 0 0 30rpx;
	border-radius: 0 0 30rpx 30rpx;

}

.topView {
	position: relative;
	box-sizing: border-box;

	// padding-bottom: 20rpx;
	width: 690rpx;
	height: 72rpx;
	border: 1px solid #fff;
	border-radius: 100rpx;
}

.topBg {
	width: 100%;
	height: 80rpx;
	// background: linear-gradient(88deg, #C74BF0 0%, #8438FC 100%);
	// background: linear-gradient( 180deg, #D172FF 0%, #EAC3FD 100%);
	/* #ifdef MP||APP-PLUS */
	margin-bottom: $MPTop;
	/* #endif */
	// image{
	// 	width: 100%;
	// 	height: 100%;
	// }
}

.left {
	margin-top: 10rpx;
	margin-right: 18rpx;
}

.left {
	position: relative;
	width: 336rpx;
	height: 404rpx;
	background: linear-gradient(207deg, #ADB8FD 0%, #7F75FB 100%);
	border-radius: 20rpx 20rpx 20rpx 20rpx;
}

.right_b {
	position: relative;
	width: 336rpx;
	height: 194rpx;
	background: linear-gradient(180deg, #F8606F 0%, #FAA5AD 100%);
	border-radius: 20rpx 20rpx 20rpx 20rpx;
}

.right_t {
	position: relative;
	width: 336rpx;
	height: 194rpx;
	background: linear-gradient(220deg, #FBA349 0%, #FFCA95 100%);
	border-radius: 20rpx 20rpx 20rpx 20rpx;
	margin-bottom: 10rpx;
}

.text {
	padding: 30rpx;
	position: absolute;
	z-index: 66;

}

.text1 {
	font-family: PingFang SC, PingFang SC;
	font-weight: bold;
	font-size: 36rpx;
	color: #FFFFFF;
	line-height: 50rpx;
}

.text2 {
	font-family: PingFang SC, PingFang SC;
	font-weight: 400;
	font-size: 24rpx;
	color: #FFFFFF;
	line-height: 34rpx;

}

.left_img {
	width: 264rpx;
	height: 264rpx;
	position: absolute;
	right: 5rpx;
	bottom: 5rpx;
}

.right_b_img,
.right_t_img {
	width: 192rpx;
	height: 192rpx;
	position: absolute;
	right: 5rpx;
	bottom: 5rpx;
}

.dizhi {

	margin-left: 30rpx;
	width: 32rpx;
	height: 32rpx;
}

.city {
	margin: 0 4rpx;
	font-size: 30rpx;
	font-family: PingFang SC-Bold, PingFang SC;
	// font-weight: bold;
	color: #fff;
}

.jiantou {
	margin-left: 10rpx;
	width: 32rpx;
	height: 32rpx;
}

.leftView {
	color: #fff;
	// width: 180rpx;
}

.rightView {
	margin: 0rpx 0rpx;
	height: 68rpx;
	// background: #FFFFFF;
	border-radius: 36rpx;

	input {
		padding-left: 10rpx;
		font-size: 28rpx;
		font-family: PingFang SC-Regular, PingFang SC;
		font-weight: 400;
		color: #fff;
	}
}

.ssImage {
	margin: 0 4rpx;
	width: 136rpx;
	line-height: 64rpx;
	font-size: 30rpx;
	color: #3D3D3D;
	text-align: center;


	background: linear-gradient(180deg, #FFFFFF 0%, #EAAFFF 100%);
	border-radius: 302rpx 302rpx 302rpx 302rpx;
}

.sousuoView {
	margin: 32rpx 26rpx;
	height: 72rpx;
	background: #FFFFFF;
	border-radius: 36rpx;

	input {
		font-size: 28rpx;
		font-family: PingFang SC-Regular, PingFang SC;
		font-weight: 400;
		color: #999999;
	}
}

.sousuoImage {
	margin-left: 28rpx;
	width: 40rpx;
	height: 40rpx;
}

.swipe {
	// margin: 20rpx 30rpx;
	margin-top: 10rpx;
	margin-bottom: 0rpx;
	// height: 145px;
	background-color: #ffffff;
	border-radius: 20rpx 20rpx 20rpx 20rpx;
}

.notice {
	margin: 0 34rpx;
	margin-top: 100rpx;
	height: 66rpx;
	background: #5204CC1F;

}

.ttImage {
	// margin: 0 12rpx;
	margin-left: 12rpx;
	// margin-right: -10rpx;
	width: 98rpx;
	height: 48rpx;

	image {
		width: 100%;
		height: 100%;
	}
}

.notice-center {
	margin-left: -12rpx;
	// padding-right: 120rpx;
	font-size: 28rpx;
	font-family: PingFang SC;
	font-weight: 500;
	line-height: 1;

	color: #5406CD;
	overflow: hidden;
	// overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;

}

.navView {
	margin: 20rpx 30rpx;
}

.navItem {
	padding: 0rpx 24rpx;
	height: 54rpx;
	border-radius: 46rpx;
	background: #EDEDED;
	font-size: 30rpx;
	font-family: PingFang SC-Regular, PingFang SC;
	font-weight: 400;
	color: #666666;

}

.selected {
	background: linear-gradient(90deg, #C64BF1 0%, #8538FC 100%);
	color: #FFFFFF;
}

.nav {
	margin: 20rpx 46rpx;
	margin-bottom: 0rpx;
	text-align: center;
}

.nav_box {
	text-align: center;

	image {
		display: flex;
		width: 96rpx;
		height: 96rpx;
	}

	text {
		margin-top: 20rpx;
		font-size: 24rpx;
		font-family: Microsoft YaHei-Regular, Microsoft YaHei;
		font-weight: 400;
		color: #333333;
	}
}

.item {
	position: relative;
	margin-top: 30rpx;
	width: 336rpx;
	// height: 418rpx;
	// background: #FFFFFF;
	border-radius: 20rpx;
}

.head {
	position: relative;
	width: 340rpx;
	height: 430rpx;
	border-radius: 20rpx 20rpx 20rpx 20rpx;

	image {
		width: 100%;
		height: 100%;
		border-radius: 20rpx;


	}
}

.xinzeng {
	padding: 0 16rpx 10rpx;
	position: absolute;
	left: 0;
	bottom: 0rpx;
	z-index: 9;
	font-size: 26rpx;
	color: #FFFFFF;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, #000000 100%);
	border-radius: 20rpx;
	width: 340rpx;
	height: 156rpx;
	background: rgba(61, 61, 61, 0.4);
	border-radius: 0rpx 0rpx 20rpx 20rpx;

	.dashang {
		width: 88rpx;
		line-height: 50rpx;
		text-align: center;
		border: 1px solid #8B3BFB;
		border-radius: 100rpx;
	}

	.shoucang {

		width: 98rpx;
		height: 50rpx;
		text-align: center;
		line-height: 50rpx;
		border-radius: 330rpx 330rpx 330rpx 330rpx;
		border: 2rpx solid #DCAF74;
		font-size: 24rpx;
		color: #D1727B;
	}

	.jianmian {
		width: 136rpx;
		line-height: 50rpx;
		background: linear-gradient(270deg, #893AF7 0%, #C34BF0 100%);
		text-align: center;
		border-radius: 110rpx;
	}
}

.zaixian {
	position: absolute;
	top: 20rpx;
	right: 0rpx;
	// width: 100rpx;
	height: 40rpx;
	background: #0000004d;
	border-radius: 60rpx 0 0 60rpx;
	font-size: 20rpx;
	font-family: PingFang SC-Regular, PingFang SC;
	font-weight: 400;
	color: #fff;
	padding: 0 10rpx;
	// color: #15FA47;
	// z-index: 2;
}

.lixian {
	// width: 80rpx;
	color: #DADADA;
}

.lixian1 {
	// width: 120rpx;
}

.name {
	margin: 10rpx;
	font-family: PingFang SC, PingFang SC;
	font-weight: 500;
	font-size: 26rpx;
	color: #FFFFFF;
	line-height: 34rpx;
}

.real {
	margin-left: 8rpx;
	// width: 68rpx;
	// height: 32rpx;
	// font-size: 20rpx;
	// font-family: PingFang SC-Regular, PingFang SC;
	// font-weight: 400;
	// color: #FFFFFF;
	// color: #333;
	// background: #bf69ca;
	// border-radius: 4rpx 4rpx 4rpx 4rpx;
	// opacity: 0.6;
	/* 矩形 */


	width: 80rpx;
	height: 40rpx;
	font-size: 26rpx;
	color: #ffffff;
	border-radius: 790rpx;
	background: #FF8E3B;

}

.address {
	image {
		width: 32rpx;
		height: 32rpx;
	}

	font-size: 24rpx;
	font-family: PingFang SC-Medium,
	PingFang SC;
	font-weight: 500;
	// color: #a541f6;
	color: #333;
}

.height {
	font-family: PingFang SC, PingFang SC;
	font-weight: 400;
	font-size: 20rpx;
	color: #55CDF9;
	line-height: 28rpx;
	text-align: left;
}

.weight {
	font-family: PingFang SC, PingFang SC;
	font-weight: 400;
	font-size: 20rpx;
	color: #F0C9CC;
	line-height: 28rpx;
	text-align: left;
}

.distance {
	font-family: PingFang SC, PingFang SC;
	font-weight: 400;
	font-size: 24rpx;
	color: #FFFFFF;
	line-height: 34rpx;
	text-align: left;
	font-style: normal;
}

.flex1 {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 306rpx;
}

//打赏弹窗
.mod-box {
	width: 652rpx;
	height: 784rpx;
	background: #FFFFFF;
	border-radius: 40rpx 40rpx 40rpx 40rpx;
	opacity: 1;
}

.modTitle {
	margin-top: 52rpx;
	margin-left: 60rpx;
	font-size: 40rpx;
	font-family: PingFang SC-Bold, PingFang SC;
	font-weight: bold;
	color: #333333;
}

.moneyList {
	margin-top: 10rpx;
}

.boxM {
	margin: 10rpx;
	width: 164rpx;
	height: 90rpx;
	background: #F8F8F8;
	border-radius: 20rpx;
	color: #333333;
	opacity: 1;
}

.boxM1 {
	color: #C74BF0;
	border: 2rpx solid #C74BF0;
}

.inputView {
	margin-top: 20rpx;
	width: 522rpx;
	height: 90rpx;
	background: #F8F8F8;
	border-radius: 20rpx 20rpx 20rpx 20rpx;
	opacity: 1;
	padding-left: 30rpx;

	input {
		width: 100%;
		height: 100%;
	}
}

.modTitle1 {
	margin-top: 18rpx;
	margin-left: 78rpx;
	font-size: 26rpx;
	font-family: PingFang SC-Regular, PingFang SC;
	font-weight: 400;
	color: #999999;
}

.modButton {
	margin-top: 32rpx;
	width: 534rpx;
	height: 102rpx;
	background: linear-gradient(91deg, #C74BF0 0%, #8438FC 100%);
	border-radius: 20rpx 20rpx 20rpx 20rpx;
	opacity: 1;
	font-size: 30rpx;
	font-family: PingFang SC-Bold, PingFang SC;
	font-weight: bold;
	color: #FFFFFF;
}

//
.jm-box {
	width: 652rpx;
	min-height: 800rpx;
	background: #FFFFFF;
	border-radius: 40rpx 40rpx 40rpx 40rpx;
	padding: 40rpx 30rpx;
	opacity: 1;

	.header {
		display: flex;
		align-items: center;
	}

	.txt {
		font-family: PingFangSC-Semibold;
		font-size: 30rpx;
		font-weight: normal;
		line-height: 38rpx;
		letter-spacing: 0px;
		color: #333333;
		margin: 30rpx 0;
	}

	.active {
		display: flex;
		align-items: center;
		// width: 600rpx;
		//超出一行省略号

	}

	.mydizhi {
		width: 600rpx;
		font-size: 28rpx;
		margin-left: 10rpx;
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
	}
}

.itembox {
	display: flex;
	flex-wrap: wrap;
	width: 720rpx;
}

.item1 {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	width: 216rpx;
	height: 172rpx;
	border-radius: 8rpx;
	box-sizing: border-box;
	border: 1px solid #EEEEEE;
	margin: 0 20rpx 30rpx 0;

}


.xmName {
	font-size: 26rpx;
	font-family: PingFang SC-Bold, PingFang SC;
	// font-weight: bold;
	color: #333333;
}

.xmName0 {
	font-size: 26rpx;
	font-family: PingFang SC-Bold, PingFang SC;
	// font-weight: bold;
	color: #fff;
}


.price {
	font-size: 24rpx;
	font-family: PingFang SC-Bold, PingFang SC;
	color: #FF4C4C;
	// font-weight: bold;
	// color: #333333;
}

.price1 {
	font-size: 32rpx;
	font-family: PingFang SC-Bold, PingFang SC;
	color: #FF4C4C;
	// font-weight: bold;
	// color: #333333;
}

.price2 {
	font-size: 24rpx;
	font-family: PingFang SC-Bold, PingFang SC;
	color: #FF4C4C;
	// font-weight: bold;
	// color: #333333;
}

.price0 {
	font-size: 24rpx;
	font-family: PingFang SC-Bold, PingFang SC;
	color: #fff;
	// font-weight: bold;
	// color: #333333;
}

.price01 {
	font-size: 32rpx;
	font-family: PingFang SC-Bold, PingFang SC;
	color: #fff;
	// font-weight: bold;
	// color: #333333;
}

.price02 {
	font-size: 24rpx;
	font-family: PingFang SC-Bold, PingFang SC;
	color: #fff;
	// font-weight: bold;
	// color: #333333;
}

.bottomButton {
	// margin-right: 30rpx;
	width: 690rpx;
	height: 80rpx;
	background: linear-gradient(90deg, #C74BF1 0%, #8538FC 100%);
	border-radius: 60rpx 60rpx 60rpx 60rpx;
	opacity: 1;
	font-size: 30rpx;
	font-family: PingFang SC-Bold, PingFang SC;
	font-weight: bold;
	color: #FFFFFF;
}

.i {
	// border: 1px solid #a642f3;
	// width: 212rpx;
	// height: 186rpx;
	color: #FFFFFF;
	background: #DE9CFF;
	border-radius: 20rpx 20rpx 20rpx 20rpx;
	border: 4rpx solid #9D40F3;
}
.icon1{
	width: 80rpx;
	height: 80rpx;
}
.iconTitle{
	font-size: 26rpx;
}
</style>